package com.youease.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class PropertiesRead {
	public static Map<String,String> readProp() {
		Map<String,String> map = new LinkedHashMap<String, String>();
		
		Properties prop = new Properties();
		try {
			InputStream in = PropertiesRead.class.getResourceAsStream("/prop.properties");
			prop.load(in);
		} catch (IOException e) {
			e.printStackTrace();
		}
		Set<Object> keyValue = prop.keySet();
		for (Iterator<Object> it = keyValue.iterator(); it.hasNext();)
		{
			String key = (String) it.next();
			String value = (String)prop.get(key);
//			System.out.println(key+":"+value);
			map.put(key, value);
		}
		return map;
	}
	
	public static void main(String[] args) {
		readProp();
	}
}
